New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12.0][FIX] Autovacuum cron job #163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR of quality and the detailed description!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, but should we instead cherry-pick a89d1d8 regarding the XML data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's OK as it is
/ocabot merge |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 380007c. Thanks a lot for contributing to OCA. ❤️ PS: Don't worry if GitHub says there are unmerged commits: it is due to a rebase before merge. All commits of this PR have been merged into |
state
is not set tocode
on the AutoVacuum Job Queueir.cron
data record, so the default actionobject_write
is assigned to it on creation, as a result, the cron job does nothing when it runs (jobs older than 30 days are not being deleted).Affected versions: 12.0, this was already fixed for 11.0 in #112
I've also added a test case and a migration to update the record for existing installations (since the record is marked as
noupdate="1"
).If, like me, you did not notice it for quite a while and now have hundreds of thousands of old jobs (or even more), running the fixed autovacuum cron job will most likely fail due to memory error or a timeout (depends on the setup, of course). To work around that, I've copied the original AutoVacuum Job Queue cron job record and used this for
code
:and setup to run this Cron job e.g. every 5 minutes to clear away the build-up.